package org.dochandler.service.core;

import org.dochandler.dao.PrivilegeDAO;
import org.dochandler.service.PrivilegeService;
import org.dochandler.service.domain.Officer;
import org.dochandler.service.domain.annotation.CaptainsAndCommandersOnly;
import org.esfinge.guardian.utils.ServiceLocator;

public class PrivilegeServiceCore implements PrivilegeService {
	private PrivilegeDAO privilegeDAO;
	
	public PrivilegeServiceCore() {
		this.privilegeDAO = ServiceLocator.getServiceImplementation( PrivilegeDAO.class );
	}
	
	@Override
	@CaptainsAndCommandersOnly
	public Boolean assignAsACommander(Officer officer) {
		return privilegeDAO.insert();
	}
	
	/*
	 * SETTERS AND GETTERS
	 */

	public PrivilegeDAO getPrivilegeDAO() {
		return privilegeDAO;
	}

	public void setPrivilegeDAO(PrivilegeDAO privilegeDAO) {
		this.privilegeDAO = privilegeDAO;
	}
}
